package com.weihoo.manager.config;

import com.weihoo.manager.service.IHelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.caucho.HessianServiceExporter;
import org.springframework.remoting.rmi.RmiServiceExporter;

/**
 * @Author houyeping
 * @Date 2017/11/24 16:41
 * @Description
 */
@Configuration
public class HessianConfig {

    @Autowired
    private IHelloService helloService;

    @Bean(name="/helloService")
    public HessianServiceExporter hessianServiceExporter(){
        HessianServiceExporter hessianServiceExporter = new HessianServiceExporter();
        hessianServiceExporter.setService(helloService);//接口
        hessianServiceExporter.setServiceInterface(IHelloService.class);
        hessianServiceExporter.setDebug(true);
        return hessianServiceExporter;
    }


}
